package net.zjitc.myqueue.myservice;

/**
 * Created by Administrator on 2017/4/6.
 */
public class Demo {
    public static void main(String[] args) {
        /*在new机器的时候指定最大容量
        * 传一个容器参数给机器
        * */
        MachineQueue mq = new MachineQueue(100);

        /*窗口管理的是机器产生的队列，以机器的队列作为参数传给窗口*/
       /* WindowsService ws = new WindowsService(mq.getQueue());*/
       Integer num = 2;
       WindowsService[] ws = new WindowsService[num];
        for (int i = 0; i <num ; i++) {
            ws[i] = new WindowsService(mq.getQueue());
            ws[i].setName(""+(i+1));
            ws[i].start();
        }


        mq.start();
       /* ws.start();*/
    }
}
